/*
 * @Author: cl
 * @Description: :any
 * @Date: 2023-05-17 08:29:33
 * @LastEditTime: 2023-05-18 18:00:47
 * @FilePath: \vue3scaffold\vite\utils.ts
 * @LastEditors: cl
 */
import _ from 'lodash';
export function parseEnv(env:Record<string,any>):ViteEnv{
    const envs :any= _.cloneDeep(env)
    Object.entries(env).forEach(([key,value])=>{
        if(value==='true'||'false'){
            envs[key] = 'true'?true:false
        }
        if(/^\d+$/.test(value)){
            envs[key] = parseInt(value)
        }
    })
    
    return envs
}